home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / pc / windows / qtw_201 / setup / samples / p9000 / dispatch.asm next >
Encoding:
Assembly Source File  |  1994-12-19  |  2.1 KB  |  78 lines

  1. ; ---------------------------------------------------------------------
  2. ;
  3. ; DISPATCH.ASM  Sample VHDW Component dispatch
  4. ;
  5. ;               Version 1.0
  6. ;
  7. ;               (c) Copyright 1988-1994 Apple Computer, Inc. All Rights Reserved.
  8. ;
  9. ; ---------------------------------------------------------------------
  10.  
  11.         INCLUDE QTMACROS.INC
  12.  
  13. DGROUP  GROUP   _DATA
  14. _DATA   SEGMENT PARA PUBLIC 'DATA'
  15. _DATA   ENDS
  16.  
  17. CODESEG SEGMENT PARA USE16 PUBLIC 'CODE'
  18.         OPTION  LANGUAGE:C
  19.         .386
  20.         ASSUME  DS:DGROUP
  21.  
  22.  
  23. ; Forward References
  24. ; ------------------
  25.         EXTERN  C cfOpenSelect:NEAR
  26.         EXTERN  C cfCloseSelect:NEAR
  27.         EXTERN  C cfCanDoSelect:NEAR
  28.         EXTERN  C cfVersionSelect:NEAR
  29.         EXTERN  C cfRegisterSelect:NEAR
  30.         EXTERN  C cfTargetSelect:NEAR
  31.         EXTERN  C cfSniffVideoHardware:NEAR
  32.  
  33.  
  34. ; Vector Table for Required Selectors
  35. ; -----------------------------------
  36. SelTab:
  37.         DW      cfOpenSelect
  38.         DW      cfCloseSelect
  39.         DW      cfCanDoSelect
  40.         DW      cfVersionSelect
  41.         DW      cfRegisterSelect
  42.         DW      cfTargetSelect
  43.  
  44.  
  45. ; ---------------------------------------------------------------------
  46. ; VHDW Component Entry Point
  47. ; ---------------------------------------------------------------------
  48. VHDWEntry PROC  FAR
  49.  
  50. ; Negative selectors represent entry points required by the component manager
  51. ; Other selectors are unique to this component
  52.         TEST    BX, BX
  53.         JL      ReqSel
  54.  
  55. ; The only selector this component handles is kSniffVideoHardware
  56.         MOV     AX, DGROUP
  57.         MOV     DS, AX
  58.         CMP     BX, kSniffVideoHardware
  59.         JE      cfSniffVideoHardware
  60.  
  61. ; 0x80008002 is the magic return code for a bad selector
  62.         MOV     DX, 8000h
  63.         MOV     AX, 8002h
  64.         RET
  65.  
  66. ; Handle the required negative selectors
  67. ReqSel: NEG     BX
  68.         DEC     BX
  69.         ADD     BX, BX
  70.         MOV     AX, DGROUP
  71.         MOV     DS, AX
  72.         JMP     WORD PTR cs:SelTab [BX]
  73.  
  74. ; All done!
  75. VHDWEntry ENDP
  76. CODESEG ENDS
  77.         END
  78.